<template>
	<view>
		<view v-for="(item, i) in dataList">			
			<image v-if="type==1" class="img" :src="item.image" mode="widthFix">
			<video v-if="type==2" class="img" :src="item.video" controls></video>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList:[],
				type: 1,
				channel: 26
			}
		},
		methods: {
			async getAllImages(){
				let res = await this.$api.getArchives({
					model:4,
					channel:this.channel,
					condition: "'" + this.type + "' = `case_type`"
				});
				this.dataList = res.data.archivesList;
			}
		},
		onLoad(option){
			this.type = option.type;
			this.channel = parseInt(option.channel);
			this.getAllImages();
		}
	}
</script>

<style>
	.img {
		width: 100%;
	}
</style>
